/*
	Name:9_T4
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>
char *substr(char *s,int statr,int len);

int main()
{
	char *s="12345678",*p;
	p = substr(s,0,4);
	printf("%s\n",p);
	free(p);
}

char *substr(char *s,int start,int len)
{
	int i;
	char *p;
	p = (char *)calloc(len+1,sizeof(char));
	s+=start;
	for(i=0;i<len;i++)
		*(p+i) = *(s+i);
	*(p+i) = '\0';
	return p;
}
